<header style="position: relative">
  <div id="nav">
    <div style="display: flex;align-items: center;">
      <img src="https://ujia-img.oss-cn-shenzhen.aliyuncs.com/beauthome/logo-mobile-nav.png" style="width: 100px;margin-left: 20px" />
    </div>
    <ul>
      <li><a href="{$Request.root.true}">首页</a></li>
      <li><a href="{$Request.root}/esthetics.html">整体软装</a></li>
      <li><a href="{$Request.root}/customization">全屋定制</a></li>
      <li><a href="{$Request.root}/cases.html">实景案例</a></li>
      <li><a href="{$Request.root}/building.html">楼盘团购</a></li>
      <li><a href="{$Request.root}/baike.html">软装百科</a></li>
      <li><a href="{$Request.root}/about.html">关于我们</a></li>
      <li><a href="{$Request.root}/news.html">公司动态</a></li>
    </ul>
  </div>
  <div id="nav-toggle">
    <img src="https://res.bestyoujia.com/web/ZMYJ/assets/img/open.png" style="width: 45%" />
  </div>
  <div id="nav-box">
    <div id="nav-open">
      <a href="{$Request.root.true}">首页</a>
      <a href="{$Request.root}/esthetics.html">整体软装</a>
      <a href="{$Request.root}/customization.html">全屋定制</a>
      <a href="{$Request.root}/cases.html">实景案例</a>
      <a href="{$Request.root}/building.html">楼盘团购</a>
      <a href="{$Request.root}/baike.html">软装百科</a>
      <a href="{$Request.root}/about.html">关于我们</a>
      <a href="{$Request.root}/news.html">公司动态</a>
    </div>
  </div>
</header>
<script>
    $(function(){
        // 页面预约位置标识
        window.page_postion = '';
    });

    let isNavOpen = false;
    $('#nav-toggle').on('click', function () {
        isNavOpen = !isNavOpen;
        if(isNavOpen){
            $('#nav > ul').hide();
            $('#nav-toggle > img').attr('src', 'https://ujia-img.oss-cn-shenzhen.aliyuncs.com/beauthome/bottom/mobile/close.png');
        }else {
            $('#nav > ul').show();
            $('.beaut-container').css('margin-top', '50px');
            $('#nav-toggle > img').attr('src', 'https://res.bestyoujia.com/web/ZMYJ/assets/img/open.png');
        }
        $('#nav-box').slideToggle(function () {
            if(isNavOpen){
                const navBoxHeight = $('#nav-box').height();
                $('.beaut-container').css('margin-top', navBoxHeight + 50);
            }else {
            }
        });
        console.log('isNavOpen', isNavOpen);
    });

</script>